ValidatorDescriptor<T>
Used for providing metadata about a validator.
Assembly: ServiceStack.dll
View Source
public class ValidatorDescriptor<T> : IValidatorDescriptor
Properties
Rules
Rules associated with the validator
View Source
protected IEnumerable<IValidationRule> Rules { get; }
Methods
GetName(String)
Gets the display name or a property property
View Source
public virtual string GetName(string property)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | property |
GetMembersWithValidators()
Gets all members with their associated validators
View Source
public virtual ILookup<string, IPropertyValidator> GetMembersWithValidators()
Returns
System.Linq.ILookup<System.String,ServiceStack.FluentValidation.Validators.IPropertyValidator>
GetValidatorsForMember(String)
Gets validators for a specific member
View Source
public IEnumerable<IPropertyValidator> GetValidatorsForMember(string name)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.Validators.IPropertyValidator>
Parameters
Type | Name |
---|---|
System.String | name |
GetRulesForMember(String)
Gets rules for a specific member
View Source
public IEnumerable<IValidationRule> GetRulesForMember(string name)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.IValidationRule>
Parameters
Type | Name |
---|---|
System.String | name |
GetName(Expression<Func<T, Object>>)
Gets the member name from an expression
View Source
public virtual string GetName(Expression<Func<T, object>> propertyExpression)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Linq.Expressions.Expression<System.Func<<T>,System.Object>> | propertyExpression |
GetValidatorsForMember<TValue>(MemberAccessor<T, TValue>)
Gets validators for a member
View Source
public IEnumerable<IPropertyValidator> GetValidatorsForMember<TValue>(MemberAccessor<T, TValue> accessor)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.Validators.IPropertyValidator>
Parameters
Type | Name |
---|---|
ServiceStack.FluentValidation.Internal.MemberAccessor<<T>,<TValue>> | accessor |
Type Parameters
TValue
GetRulesByRuleset()
Gets rules grouped by ruleset
View Source
public IEnumerable<ValidatorDescriptor<T>.RulesetMetadata> GetRulesByRuleset()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.FluentValidation.ValidatorDescriptor`1.RulesetMetadata>